package net.risesoft.y9.pubsub.event;

import org.springframework.context.ApplicationEvent;

/**
 * 通用事件
 *
 * @author dingzhaojun
 * @author qinman
 * @author mengjuhua
 * @date 2022/2/10
 */
public class Y9EventCommon extends ApplicationEvent {
    private static final long serialVersionUID = 6197864557550039984L;

    public static final String TENANT_DATASOURCE_SYNC = "TENANT_DATASOURCE_SYNC";
    public static final String REFRESH_REMOTE_APPLICATION_EVENT = "RefreshRemoteApplicationEvent";

    private Object eventObject;
    private String eventType;
    private String eventTarget;

    public Y9EventCommon() {
        super("event source");
    }

    public Y9EventCommon(Object eventObject, String eventType, String eventTarget) {
        super("event source");
        this.eventObject = eventObject;
        this.eventType = eventType;
        this.eventTarget = eventTarget;
    }

    public Object getEventObject() {
        return eventObject;
    }

    public String getEventTarget() {
        return eventTarget;
    }

    public String getEventType() {
        return eventType;
    }

    public void setEventObject(Object eventObject) {
        this.eventObject = eventObject;
    }

    public void setEventTarget(String eventTarget) {
        this.eventTarget = eventTarget;
    }

    public void setEventType(String eventType) {
        this.eventType = eventType;
    }

    @Override
    public String toString() {
        return "RiseCommonEvent [eventObject=" + eventObject + ", eventType=" + eventType + ", eventTarget=" + eventTarget + "]";
    }

}